<?php
	if ($_POST)
	{
		require('config.php');
		$fav_type = $_POST["fav_type"];
		if (isset($_COOKIE['userid']) && $_COOKIE['userid'] != '')
		{
            $stmt = $connection->prepare('delete from user_fav_lists where user_id=? and fav_type=?');
            $stmt->bind_param("ss", $_COOKIE['userid'], $fav_type);
            $stmt->execute();
            $stmt = $connection->prepare('delete from user_fav where user_id=? and fav_type=?');
            $stmt->bind_param("ss", $_COOKIE['userid'], $fav_type);
            $stmt->execute();
            echo "true";
		}
		else
		{
			echo "NOUSER";	
		}
        $connection->close();
	}
	else
	{
		echo "NOPOST";	
	}
?>
